﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace md.imi.membrane.common.Messaging
{
    public enum DestinationType
    {
        GeneratedLanguageTarget = 1,
        LogsTarget
    } ;
    
    /// <summary>
    ///     Message data class is used to carry out message information which is 
    /// sent to a dedicated target view
    /// </summary>
    public class MessageData
    {
        /// <summary>
        ///     Data caryied out by the message
        /// </summary>
        public object Data { get; set; }

        /// <summary>
        ///         The source object, which has sent the message.
        /// Not always set, due to memory management issues.
        /// </summary>
        public object Source { get; set; }

        /// <summary>
        ///     The destination view (class of view). THhe message manager 
        /// searches for given type in the list of registered listeners, and
        /// if it is foun, the message is passed in.
        /// </summary>
        public DestinationType Destination { get; set; }

        /// <summary>
        ///     Default constructor
        /// </summary>
        public MessageData()
        {
        }

        /// <summary>
        ///     Initialization constructor
        /// </summary>
        /// <param name="source"></param>
        /// <param name="destination"></param>
        /// <param name="data"></param>
        public MessageData(object source, DestinationType destination, object data)
        {
            Source = source;
            Destination = destination;
            Data = data;

        }

    }
}
